function  shallowClone (obj) {
  let cloneObj = {}
  for(let i  in obj) {
    cloneObj[i] = obj[i]
  }
  return cloneObj;
}

let obj = {
  name: 'zxw',
  age: 12,
  card:['visa','cb'],
  child : {
    name: 'zxw'
  }
}

let clone  = shallowClone(obj)
clone.card.push('vue')
console.log(clone.card, obj.card)  // 因为浅克隆的对象的引用值是拷贝对象里的引用，这两个对象的card指向的地方是一致的。
